<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>class RFF::VideoHandler - RDoc Documentation</title>

<link href="../fonts.css" rel="stylesheet">
<link href="../rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
</script>

<script src="../js/jquery.js"></script>
<script src="../js/navigation.js"></script>
<script src="../js/search_index.js"></script>
<script src="../js/search.js"></script>
<script src="../js/searcher.js"></script>
<script src="../js/darkfish.js"></script>


<body id="top" role="document" class="class">
<nav role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  <div id="class-metadata">
    
    <div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  
  <p class="link">Object
  
</div>

    
    
    <!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    
    <li ><a href="#method-c-new">::new</a>
    
    <li ><a href="#method-i-custom_args">#custom_args</a>
    
    <li ><a href="#method-i-fire_all">#fire_all</a>
    
    <li ><a href="#method-i-fire_sequential">#fire_sequential</a>
    
    <li ><a href="#method-i-format_processing_percentage">#format_processing_percentage</a>
    
    <li ><a href="#method-i-input">#input</a>
    
    <li ><a href="#method-i-killall">#killall</a>
    
    <li ><a href="#method-i-mp4_processor">#mp4_processor</a>
    
    <li ><a href="#method-i-ogv_processor">#ogv_processor</a>
    
    <li ><a href="#method-i-output_name">#output_name</a>
    
    <li ><a href="#method-i-output_path">#output_path</a>
    
    <li ><a href="#method-i-processing_percentage">#processing_percentage</a>
    
    <li ><a href="#method-i-quality">#quality</a>
    
    <li ><a href="#method-i-webm_processor">#webm_processor</a>
    
  </ul>
</div>

  </div>
</nav>

<main role="main" aria-labelledby="class-RFF::VideoHandler">
  <h1 id="class-RFF::VideoHandler" class="class">
    class RFF::VideoHandler
  </h1>

  <section class="description">
    
<p>This class provides an “All video to HTML5” conversion functionality. It
takes every compatible with FFmpeg video format and converts it to the
three HTML5 video formats - mp4, ogv and webm. If the input is already in
one of these formats it is only converted to the two other formats and the
original file is copied to the output directory, because it can be used as
one of HTML5 sources.</p>

  </section>

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    

    

    
     <section id="public-class-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Class Methods</h3>
       </header>

    
      <div id="method-c-new" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">new</span><span
            class="method-args">(input, output_path=nil, quality="5000k", custom_args=nil, recommended_audio_quality=true, disable_subtitles_decoding=true)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This constructor initializes the class with the following arguments:</p>
<ul><li>
<p><em>input</em> <strong>(required)</strong> - the full path to the input
file</p>
</li><li>
<p><em>output_path</em> - a path to place the output file in. Defaults to nil,
which means that the input&#39; s directory path is used</p>
</li><li>
<p><em>quality</em> - only affects video conversion. Sets the video conversion
quality. Defaults to 5000k, which is tested value for good video conversion
quality</p>
</li><li>
<p><em>custom_args</em> - passes custom arguments to FFmpeg. Defaults to nil,
which means no custom arguments are given</p>
</li><li>
<p><em>recommended_audio_quality</em> - determines if recommended by FFmpeg
community audio quality settings should be used. Defaults to true, which
means audio conversion with good, recommended quality. Set to false if you
are giving additional arguments that determine this quality.</p>
</li><li>
<p><em>disable_subtitles_decoding</em> - in some formats subtitle decoding
causes problems. This option disables this feature. Defaults to true to
bypass problems by default.</p>
</li></ul>

<p>All of the arguments are passed on to underlying <a
href="Processor.html">Processor</a> instances. This method also determines
input type, initializes processing percentage and creates needed <a
href="Processor.html">Processor</a> instances.</p>
          
          

          
          <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output_path</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">quality</span>=<span class="ruby-string">&quot;5000k&quot;</span>, <span class="ruby-identifier">custom_args</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">recommended_audio_quality</span>=<span class="ruby-keyword">true</span>, <span class="ruby-identifier">disable_subtitles_decoding</span>=<span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@input</span> = <span class="ruby-identifier">input</span>
  <span class="ruby-ivar">@input_type</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-ivar">@input</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;.&quot;</span>)[<span class="ruby-value">1</span>]
  <span class="ruby-ivar">@output_path</span> = <span class="ruby-identifier">output_path</span>
  <span class="ruby-ivar">@quality</span> = <span class="ruby-identifier">quality</span>
  <span class="ruby-ivar">@custom_args</span> = <span class="ruby-identifier">custom_args</span>
  <span class="ruby-ivar">@processing_percentage</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@processors</span> = []
  <span class="ruby-identifier">types</span> = [<span class="ruby-value">:mp4</span>, <span class="ruby-value">:ogv</span>, <span class="ruby-value">:webm</span>]
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@output_path</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-ivar">@output_path</span>)
      <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-ivar">@output_path</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">types</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@input_type</span>.<span class="ruby-identifier">to_sym</span>)
    <span class="ruby-identifier">types</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-ivar">@input_type</span>.<span class="ruby-identifier">to_sym</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@output_path</span>.<span class="ruby-identifier">nil?</span>
        <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp</span> <span class="ruby-ivar">@input</span>, <span class="ruby-ivar">@output_path</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">types</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@processors</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">RFF</span><span class="ruby-operator">::</span><span class="ruby-constant">Processor</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@input</span>, <span class="ruby-identifier">type</span>, <span class="ruby-ivar">@output_path</span>, <span class="ruby-ivar">@quality</span>, <span class="ruby-ivar">@custom_args</span>, <span class="ruby-identifier">recommended_audio_quality</span>, <span class="ruby-identifier">disable_subtitles_decoding</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
    </section>
  
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Instance Methods</h3>
       </header>

    
      <div id="method-i-custom_args" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">custom_args</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns custom arguments passed to FFmpeg</p>
          
          

          
          <div class="method-source-code" id="custom_args-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 179</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">custom_args</span>
  <span class="ruby-ivar">@custom_args</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-fire_all" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">fire_all</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method fires all the <a href="Processor.html">Processor</a> instances
(conversion processes) in a separate thread at once. Then it counts the
overall processing percentage from all the <a
href="Processor.html">Processor</a> instances as the process goes and sets
it to 100% on finish</p>
          
          

          
          <div class="method-source-code" id="fire_all-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 44</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">fire_all</span>
  <span class="ruby-ivar">@processing_thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">th</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">proc</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">fire</span>
        <span class="ruby-comment">#sleep(5)</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">status</span> = <span class="ruby-value">:processing</span>
      <span class="ruby-keyword">while</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:done</span>
        <span class="ruby-identifier">donecount</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">proc</span><span class="ruby-operator">|</span>
          <span class="ruby-comment">#puts &quot;Process status:&quot; + proc.status.to_s</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">:completed</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">:failed</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">:aborted</span>
            <span class="ruby-identifier">donecount</span> = <span class="ruby-identifier">donecount</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-comment">#puts &quot;Done count: &quot; + donecount.to_s</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">donecount</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">count</span>
          <span class="ruby-identifier">status</span> = <span class="ruby-value">:done</span>
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">processing_percentage</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">proc</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">processing_percentage</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">processing_percentage</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-ivar">@processing_percentage</span> = (<span class="ruby-identifier">processing_percentage</span>.<span class="ruby-identifier">to_f</span><span class="ruby-operator">/</span><span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">count</span>).<span class="ruby-identifier">to_i</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@processing_percentage</span> = <span class="ruby-value">100</span>
    <span class="ruby-keyword">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Caught exception: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Backtrace:&quot;</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>
      <span class="ruby-ivar">@status</span> = <span class="ruby-value">:done</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-fire_sequential" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">fire_sequential</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method fires all the <a href="Processor.html">Processor</a> instances
(conversion processes) in a separate thread sequentially - next <a
href="Processor.html">Processor</a> in the row is fired only after the <a
href="Processor.html">Processor</a> before finishes. It also counts the
overall processing percentage from all the <a
href="Processor.html">Processor</a> instances as the process goes and sets
it to 100% on finish</p>
          
          

          
          <div class="method-source-code" id="fire_sequential-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 83</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">fire_sequential</span>
  <span class="ruby-ivar">@processing_thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">th</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
      <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">proc</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">fire</span>
        <span class="ruby-identifier">sleep</span>(<span class="ruby-value">1</span>)
        <span class="ruby-keyword">while</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">:processing</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">processing_percentage</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
            <span class="ruby-ivar">@processing_percentage</span> = (<span class="ruby-identifier">i</span><span class="ruby-operator">*</span>(<span class="ruby-value">100</span><span class="ruby-operator">/</span><span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">count</span>))<span class="ruby-operator">+</span>(<span class="ruby-identifier">proc</span>.<span class="ruby-identifier">processing_percentage</span>.<span class="ruby-identifier">to_f</span><span class="ruby-operator">/</span><span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">count</span>).<span class="ruby-identifier">to_i</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">i</span> = <span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>
        <span class="ruby-comment">#sleep(5)</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@processing_percentage</span> = <span class="ruby-value">100</span>
    <span class="ruby-keyword">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Caught exception: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Backtrace:&quot;</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>
      <span class="ruby-ivar">@status</span> = <span class="ruby-value">:done</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-format_processing_percentage" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">format_processing_percentage</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns percentage of process completion formatted for output</p>
          
          

          
          <div class="method-source-code" id="format_processing_percentage-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 191</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">format_processing_percentage</span>
  <span class="ruby-ivar">@processing_percentage</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;0%&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@processing_percentage</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;%&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-input" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">input</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns full input path</p>
          
          

          
          <div class="method-source-code" id="input-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 155</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">input</span>
  <span class="ruby-ivar">@input</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-killall" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">killall</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method kills all the processes in <a
href="Processor.html">Processor</a> instances and its own processing thread</p>
          
          

          
          <div class="method-source-code" id="killall-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 110</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">killall</span>
  <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">proc</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">kill</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@processing_thread</span>.<span class="ruby-identifier">kill</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-mp4_processor" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">mp4_processor</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns the “to MP4” <a href="Processor.html">Processor</a>
instance if it exists or nil otherwise</p>
          
          

          
          <div class="method-source-code" id="mp4_processor-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 119</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">mp4_processor</span>
  <span class="ruby-identifier">ret</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">proc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">output_type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:mp4</span>
      <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">proc</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">ret</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-ogv_processor" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">ogv_processor</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns the “to OGV” <a href="Processor.html">Processor</a>
instance if it exists or nil otherwise</p>
          
          

          
          <div class="method-source-code" id="ogv_processor-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 131</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">ogv_processor</span>
  <span class="ruby-identifier">ret</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">proc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">output_type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:ogv</span>
      <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">proc</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">ret</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-output_name" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">output_name</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns full output file name</p>
          
          

          
          <div class="method-source-code" id="output_name-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 161</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">output_name</span>
  <span class="ruby-ivar">@output_name</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-output_path" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">output_path</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns the path in which output file is saved</p>
          
          

          
          <div class="method-source-code" id="output_path-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 167</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">output_path</span>
  <span class="ruby-ivar">@output_path</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-processing_percentage" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">processing_percentage</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns percentage of process completion</p>
          
          

          
          <div class="method-source-code" id="processing_percentage-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 185</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">processing_percentage</span>
  <span class="ruby-ivar">@processing_percentage</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-quality" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">quality</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns used video quality</p>
          
          

          
          <div class="method-source-code" id="quality-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 173</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">quality</span>
  <span class="ruby-ivar">@quality</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-webm_processor" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">webm_processor</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method returns the “to WEBM” <a href="Processor.html">Processor</a>
instance if it exists or nil otherwise</p>
          
          

          
          <div class="method-source-code" id="webm_processor-source">
            <pre><span class="ruby-comment"># File lib/video_handler.rb, line 143</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">webm_processor</span>
  <span class="ruby-identifier">ret</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@processors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">proc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">output_type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:webm</span>
      <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">proc</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">ret</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
    </section>
  
  </section>
</main>


<footer id="validator-badges" role="contentinfo">
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
  <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>

